<?php
// https://api.kuaisohezi.com/json_info?hashes=5f7077cb72ee3624eda0d52ae878038074e359c4

$hash = $_GET['hash'];
if (empty($hash)) {
    //do something
    echo json_encode(
        array("code" => 1, //错误
            "msg" => 'no hash', //解析提示文本
            "count" => 0, //解析数据长度
            "data" => 0)); //解析数据列表
    return;
}

// echo $query_string;
$api_address = 'https://api.kuaisohezi.com/json_info?hashes=' . $hash;
// echo $api_address;
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $api_address,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_POSTFIELDS => "",
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo json_encode(
        array("code" => 2, //错误
            "msg" => "cURL Error #:" . $err, //解析提示文本
            "count" => 0, //解析数据长度
            "data" => 0)); //解析数据列表
} else {
    echo $response;
}